def merge_matrices(*matrices):
    """
    Merges multiple matrices by concatenating them column-wise.

    Args:
        *matrices: Variable number of matrices (2D lists) to be merged. The matrices must have the same number of rows.

    Returns:
        A new matrix (2D list) obtained by concatenating the input matrices column-wise.

    Raises:
        ValueError: If the input matrices have different numbers of rows.

    Example:
        matrix1 = [[1, 2],
                   [3, 4]]

        matrix2 = [[5, 6],
                   [7, 8]]

        matrix3 = [[9, 10],
                   [11, 12]]

        merged_matrix = merge_matrices(matrix1, matrix2, matrix3)
        # Output: [[1, 2, 5, 6, 9, 10],
        #          [3, 4, 7, 8, 11, 12]]

    """
    # Ensure that all matrices have the same number of rows
    row_lengths = set(len(matrix) for matrix in matrices)
    assert len(row_lengths) == 1, "All matrices must have the same number of rows."

    merged_matrix = [sum(rows, []) for rows in zip(*matrices)]
    return merged_matrix


if __name__ == '__main__':
    matrix1 = [[1, 2],
               [3, 4]]

    matrix2 = [[5, 6],
               [7, 8]]

    matrix3 = [[9, 10],
               [11, 12]]

    merged_matrix = merge_matrices(matrix1, matrix2, matrix3)
    # Output: [[1, 2, 5, 6, 9, 10],
    #          [3, 4, 7, 8, 11, 12]]